export default function throttle(fn, wait) {
    let previous = 0
    return function() {
        let context = this
        let args = [...arguments]
        let now = new Date()
        if (now - previous > wait) {
            fn.apply(context, args)
            previous = now
        }
    }
}